package com.pmcc.utils;

import com.pmcc.core.dto.Menu;
import com.pmcc.core.entity.security.Employee;
import com.pmcc.core.entity.security.Organization;
import com.pmcc.core.vo.EmployeeVo;
import com.pmcc.core.vo.MenuVo;
import com.pmcc.core.vo.OrgVo;

/**
 * Created by Hasee on 2017/12/14.
 */
public class VOUtil {

    /**
     * Menu -->VO
     *
     * @param menu
     * @return
     */
    public static MenuVo getMenuVo(Menu menu){
        MenuVo vo=new MenuVo();
        if(menu!=null){
            vo.setBpid(menu.getBpid());
            vo.setCode(menu.getCode());
            vo.setId(menu.getId());
            vo.setIcon(menu.getIcon());
            vo.setMpid(menu.getMpid());
            vo.setName(menu.getName());
            vo.setRoute(menu.getRoute());
            vo.setParentName(menu.getParentName());
            vo.setPath(menu.getPath());
            vo.setIndexPath(menu.getIndexPath());
            vo.setKey(menu.getKey());
        }
        return vo;
    }

    public static EmployeeVo getEmployeeVo(Employee employee){
        EmployeeVo vo = new EmployeeVo();
        if(employee != null){
            /*vo.setRoles(employee.getRoles());*/
            vo.setAddress(employee.getAddress());
            vo.setEmail(employee.getEmail());
            vo.setMobile(employee.getMobile());
            /*vo.setUserCName(employee.getUserCName());*/
            /*vo.setRoleId(employee.getRoleId());
            vo.setUsername(employee.getUsername());
            vo.setEnabled(employee.getEnabled());
            vo.setId(employee.getId());
            vo.setLastLoginDate(employee.getLastLoginDate());
            vo.setLastPasswordResetDate(employee.getLastPasswordResetDate());
            vo.setPassword(employee.getPassword());
            vo.setRegisterDate(employee.getRegisterDate());
            vo.setSalt(employee.getSalt());*/
        }
        return  vo;
    }

}
